<template>
    <div>
        <el-drawer title="个人设置" :visible.sync="visible" direction="rtl" close-on-press-escape>
            <div class="header">
                <div class="header-main" v-if="userinfo">
                    <img src="../../../assets/image/bg_profile2.jpg" alt="" class="profile__cover">
                    <div class="profile__name">{{userinfo.username || '&nbsp;'}}</div>
                    <ul class="mod_user_statistic">
                        <li class="user_statistic__item">
                            <strong class="user_statistic__number ">{{userinfo.groupName || '&nbsp;'}}</strong><span
                                class="user_statistic__tit">集团</span>
                        </li>
                        <li class="user_statistic__item">
                            <strong class="user_statistic__number ">{{userinfo.orgName || '&nbsp;'}}</strong><span
                                class="user_statistic__tit">组织</span>
                        </li>
                        <li class="user_statistic__item user_statistic__item--last">
                            <strong class="user_statistic__number ">{{userinfo.deptName || '&nbsp;'}}</strong><span
                                class="user_statistic__tit">部门</span>
                        </li>
                    </ul>
                </div>
                <ul class="header-tabs">
                    <li>个人资料</li>
                    <li>系统提示</li>
                    <li>访问记录</li>
                </ul>
            </div>

        </el-drawer>
    </div>
</template>
<script>
    // import * as userService from '@/api/upms/user'
    import {
        mapState,
        mapGetters
    } from 'vuex'
    export default {
        data() {
            return {
                // userinfo: {},
                visible: false
            }
        },
        computed: {
            ...mapGetters('d2admin/user', [
                'userinfo'
            ])
        },
        mounted() {
            // this.getmeInfo()
        },
        methods: {
            init(){
                this.visible = true
            },
            // getmeInfo() {
            //     userService.getmeinfo().then(data => {
            //         this.userinfo = data
            //     });
            // }
        }
    }
</script>
<style scoped>
    .header {
        background-image: url(../../../assets/image/bg_profile.jpg);
        height: 280px;
        padding-top: 15px;
        background-size: cover;
        text-align: center;
        color: #fff;
        position: relative;
    }

    .header-main {
        width: 500px;
        margin: 0 auto;
    }

    .header-tabs {
        margin: 0;
        padding: 0;
        position: absolute;
        bottom: 0px;
        font-size: 14px;
        display: flex;
        width: 100%;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: center;
    }

    .header-tabs li {
        display: block;
        width: 120px;
        height: 58px;
        line-height: 58px;
        text-align: center;
        cursor: pointer;
    }

    .header-tabs li:hover {
        background: rgba(233, 232, 232, 0.2)
    }

    .profile__cover {
        display: block;
        width: 60px;
        height: 60px;
        border: 2px solid #fff;
        border-radius: 99px;
        background: #fff;
        margin: 0 auto;
    }

    .profile__name {
        font-size: 16px;
        line-height: 40px;
        font-weight: 400;
        line-height: 40px;
        margin-right: 4px;
    }

    .mod_user_statistic {
        margin: 0;
        padding: 0;
        margin-top: 20px;
        overflow: hidden;
        font-size: 12px;
        display: flex;
        flex-wrap: nowrap;
        justify-content: space-between;
    }

    .user_statistic__number,
    .user_statistic__tit {
        font-size: 10px;
        color: #fff;
    }

    .user_statistic__number {
        display: block;
        font-size: 18px;
        line-height: 24px;
        font-weight: 400;
    }

    .user_statistic__item {
        display: inline-block;
        border-right: solid 1px #24313d;
        text-align: center;
        padding: 0 25px;
        width: 400px;
    }

    .user_statistic__number,
    .user_statistic__tit {
        color: #fff;
        margin-top: 5px;
    }

    .user_statistic__tit {
        display: block;
        color: #999;
        font-size: 14px;
    }

    li {
        list-style: none;
    }

    .user_statistic__item--last {
        border-right: 0 none;
    }
</style>